<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">

<head><title>Categories</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link href="css/common.css" rel="stylesheet" type="text/css">
</head>

<body>
<f:view>
    <f:loadBundle basename="ResourceBundle" var="bundle"/>
    <h:form id="audioContentForm">
        <div id="external">
            <div id="menu">
                <h:outputText value="#{bundle.menu_title}"/>
                <br>
                <%@ include file="menu.jsp" %>
            </div>
            <div id="languages">
                <div class="internal-languages">
                    <strong>
                        <h:commandLink value="EN"/>
                        <h:commandLink value="HI"/>
                        <h:commandLink value="TAM"/>
                    </strong>
                </div>
            </div>


            <div id="content">
                <div id="title"> ${bundle.categories_header}</div>

                <div style="position:absolute; top:7%;right: 2%; width: 35%; background-color:  #7ccff5; text-align: right;">
                    <h:outputText value="#{bundle.rowCountOnPage}"/>
                    <h:inputText readonly="true" value="12"/>
                </div>

                <div style=" position:absolute; top: 16%; height: 50%; background-color:#7ccff5; left:2%; right: 2%; outline-width:2px; outline-color: black; overflow-y: scroll;">
                    <h:dataTable value="#{categoryBean.categoryDecorators}" var="category" border="1" width="100%"
                                 headerClass="table-header">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.category_id}"/>
                            </f:facet>
                            <h:outputText value="#{category.id}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Name"/>
                            </f:facet>
                            <h:outputText value="#{category.name}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Description"/>
                            </f:facet>
                            <h:outputText value="#{category.description}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Icon"/>
                            </f:facet>
                            <h:graphicImage value="#{category.imagePath}"/>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Edit"/>
                            </f:facet>
                            <h:commandButton value="#{bundle.edit_button}" action="#{categoryBean.editCategory}">
                                <f:param name="edit_category" value="#{category.id}"/>
                            </h:commandButton>
                        </h:column>

                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Delete"/>
                            </f:facet>
                            <h:commandButton value="#{bundle.delete_button}"/>
                        </h:column>

                    </h:dataTable>
                </div>

                <div style="position:absolute; clear: left; background-color: #e8e7e9; top: 55%; height: 3%; left:2%;">${bundle.navigation}</div>

                <div style="position:absolute;top: 70%; height: 5%; right: 5%">
                    <h:commandButton value="#{bundle.addCategoryButton}" action="#{categoryBean.addCategory}"/>
                </div>
            </div>
        </div>
    </h:form>
</f:view>
</body>
</html>
